package com.sx.first.biz;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.sx.first.biz.WarehouseBiz;
import com.sx.first.dao.WarehouseDAO;
import com.sx.first.model.Warehouse;

@Service("warehouseBiz")
@Scope("prototype")
public class WarehouseBiz {
	private WarehouseDAO warehouseDAO;
	
	
	public void setWarehouseDAO(WarehouseDAO warehouseDAO) {
		this.warehouseDAO = warehouseDAO;
	}

	public List<Warehouse> findAll(){
		return warehouseDAO.findAll();
	}

	public void save(Warehouse war) {
		warehouseDAO.save(war);
		
	}

	public Warehouse findById(int warId) {
		return warehouseDAO.findById(warId);
	}

	public void delete(int warId) {
		warehouseDAO.delete(warehouseDAO.findById(warId));
		
	}

	public void update(Warehouse war) {
		warehouseDAO.update(war);
		
	}
	

}
